package com.atguigu.gmall2020.mock.db.buffer;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class BufferUtil {



    private static Map<Class, BufferQueue> bufferMap = new ConcurrentHashMap();

    public static BufferQueue  getQueue(Class  clazz){
            BufferQueue bufferQueue=bufferMap.get(clazz);
            if(bufferQueue!=null){
                return bufferQueue;
            }else{
                  bufferQueue = new BufferQueue<>();
                  bufferMap.put(clazz,bufferQueue) ;
                  return bufferQueue;
             }

    }
}
